<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
/**
 * TYPOlight Kuespert Module :: tl_modules
 *
 * Copyright (C) 2010 by TT-Tech
 *
 */

/**
 * Add palette to tl_module
 */

$GLOBALS['TL_DCA']['tl_module']['fields']['type_slider'] = array
		(
            'label'                   => &$GLOBALS['TL_LANG']['tl_module']['type_slider'],
			'inputType'               => 'select',
		    'options_callback'        => array('Sliders', 'getTypeSliders'),
		    'search'                  => true,
		    'sorting'                 => true,
		    'filter'                  => true,
		    'flag'                    => 11,
		    'exclude'                 => true
        ); 

$GLOBALS['TL_DCA']['tl_module']['palettes']['tl_images_slider'] 	= '{title_legend},name,headline,type;{Choose the group sliders},type_slider;{expert_legend:hide},guests,cssID,space';

class Sliders extends Backend
{
    public function getTypeSliders()
    {
        $obj = $this->Database->execute("SELECT id, title FROM tl_group_slider");

        if ($obj->numRows < 1) return array();

        $rs = array();  
        while ($obj->next()) 
        	$rs[$obj->id] = $obj->title; 
        return $rs;  
    }
}
    


?>
